package singotonPattern;

//1. 懒汉式单例模式
public class Singleton02 {
    private static Apple apple = null;

    public static Apple getInstance() {
        if (apple == null){
            apple = new Apple();
        }
        return apple;
    }
}
